import { request } from './request'

//新歌速递
export function  getHomeNewSong(type) {
  return request({
    url: '/top/song',
    params: {
      type: type
    }
  })
}

export function getArtistSongs(id,order,limit,offset) {
  return request({
    url: '/artist/songs',
    params: {
      id,
      order,
      limit,
      offset
    }
  })
}
export function getSongUrl(id) {
  return request({
    url: '/song/url',
    params: {
      id
    }
  })
}
export function getSongDetail(ids) {
  return request({
    url: '/song/detail',
    params: {
      ids
    }
  })
}

export class newSongList {
  constructor(data) {
    this.id = data.id,
    this.name = data.name,
    this.mp3Url = data.mp3Url
    this.albumName = data.album.name,
    this.imgUrl = data.album.picUrl,
    this.artistName = data.artists
    this.duration = data.duration
  }
}

export class setSongList {
  constructor(data) {
    this.id = data.id,
    this.name = data.name,
    this.albumName = data.al.name,
    this.artistName = data.ar
    this.duration = data.dt
  }
}